It is known that the official I2P is written in Java, which in itself repels potential users, thereby making the network less polarized than it could be. In addition, Java applications are quite resource-demanding, so running I2P on weak devices is difficult and sometimes impossible. It also turned out that Java in Africa is not the same Java, and support for strong cryptography depends on the country, which is why the mass transition to ECDSA had to be postponed.
Therefore, implementing I2P in C++ has always been a pressing task. Of the many attempts, Purple I2P is by far the most successful and practical. The name comes from the color of the shirt on the I2P icon, to distinguish it from the official I2P, where the color is red and denotes the family of applications that use this implementation of I2P. i2pd is also a general purpose I2P router.
Previously I reviewed the components necessary to build such a system. In short, to work on an I2P network you need a router that implements the following functions:
If there is a need to exchange your own data, then the router needs to place addresses, the operation of which requires additional protocols, discussed Here. However, to interact with clients, data transfer alone is not enough - you must be able to manage local addresses and be able to access remote ones. In the official I2P this is implemented as a set of separate external applications, while in i2pd these services are built-in. Currently implemented:
SAM(Simple Anonymous Messaging) for a long time was actually the only protocol suitable for full interaction with I2P from C++ applications. More precisely, there is more BOB, actually implementing the same concept, but much less widespread than SAM.
The I2CP protocol recommended by the official I2P is of little use for these purposes, since it is a lower-level protocol and uses an external thread implementation, also written in Java. There is no C++ version at the moment. In the future, it is planned to formalize the implementation of streams from i2pd in the form of a separate library working via I2CP.
For SAM, there is a ready-to-use C++ library i2psam, which is actively used by cryptocurrencies to hide their traffic.
Despite its shortcomings and criticisms, SAM is the most important protocol in I2P purple because linking an existing C++ application using SAM and i2pd allows you to immediately eliminate the use of Java without additional rework..
The most popular ones:
In general, the protocol fully lives up to its name; from the client’s point of view, it represents sockets operating either in command mode or in data transfer mode. If a client deletes a socket, the corresponding I2P construct is deleted. The work begins with creating a local address with keys specified by the client, or a temporary one with randomly generated keys. It can then either use this address to establish a connection to the remote address, or wait for the next incoming connection from the remote address. After this, the socket goes into data transfer mode.
Such an interface can be implemented as an API and used directly from the application, without the need to use an external router, and distributed as a ready-made solution without forcing the end user into the details of I2P settings.
Actually, the main idea of this article is that the first stable i2pd release containing the above functionality.
Binaries for Ubuntu:
launchpad.net/~i2p.packages/+archive/ubuntu/i2p
for Debian
deb.i2p2.no
For all other platforms compile from source from here.
Requires crypto++ and boost libraries.
Therefore, implementing I2P in C++ has always been a pressing task. Of the many attempts, Purple I2P is by far the most successful and practical. The name comes from the color of the shirt on the I2P icon, to distinguish it from the official I2P, where the color is red and denotes the family of applications that use this implementation of I2P. i2pd is also a general purpose I2P router.
Previously I reviewed the components necessary to build such a system. In short, to work on an I2P network you need a router that implements the following functions:
- Transport responsible for direct connections with other nodes. Typically via the Internet, but can also be via other networks, for example Tor
- Building and sending data through tunnels
- Search and maintain the list of other nodes up to date
- Transfer of transit traffic of other participants
If there is a need to exchange your own data, then the router needs to place addresses, the operation of which requires additional protocols, discussed Here. However, to interact with clients, data transfer alone is not enough - you must be able to manage local addresses and be able to access remote ones. In the official I2P this is implemented as a set of separate external applications, while in i2pd these services are built-in. Currently implemented:
- HTTP proxy
- I2P tunnels, which are maps of addresses to TCP ports of a local machine
- SAM - command interface. Let's look at it in more detail.
SAM protocol
SAM(Simple Anonymous Messaging) for a long time was actually the only protocol suitable for full interaction with I2P from C++ applications. More precisely, there is more BOB, actually implementing the same concept, but much less widespread than SAM.
The I2CP protocol recommended by the official I2P is of little use for these purposes, since it is a lower-level protocol and uses an external thread implementation, also written in Java. There is no C++ version at the moment. In the future, it is planned to formalize the implementation of streams from i2pd in the form of a separate library working via I2CP.
For SAM, there is a ready-to-use C++ library i2psam, which is actively used by cryptocurrencies to hide their traffic.
Despite its shortcomings and criticisms, SAM is the most important protocol in I2P purple because linking an existing C++ application using SAM and i2pd allows you to immediately eliminate the use of Java without additional rework..
The most popular ones:
- I2P-Messenger
- iMule
- Bitcoin-I2P
In general, the protocol fully lives up to its name; from the client’s point of view, it represents sockets operating either in command mode or in data transfer mode. If a client deletes a socket, the corresponding I2P construct is deleted. The work begins with creating a local address with keys specified by the client, or a temporary one with randomly generated keys. It can then either use this address to establish a connection to the remote address, or wait for the next incoming connection from the remote address. After this, the socket goes into data transfer mode.
Such an interface can be implemented as an API and used directly from the application, without the need to use an external router, and distributed as a ready-made solution without forcing the end user into the details of I2P settings.
What is planned to be implemented
- I2CP so that Java applications can run over i2pd
- Node profiler to build faster, more reliable tunnels
- Updated address book
- Datagrams
- Floodfill mode
Release 0.1.0
Actually, the main idea of this article is that the first stable i2pd release containing the above functionality.
Binaries for Ubuntu:
launchpad.net/~i2p.packages/+archive/ubuntu/i2p
for Debian
deb.i2p2.no
For all other platforms compile from source from here.
Requires crypto++ and boost libraries.